package org.domain.acount.converter;

import java.math.BigDecimal;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.NumberConverter;

 public class BigDecimalConverter extends NumberConverter 
 {
 
 public Object getAsObject(FacesContext context, UIComponent component, String input) {
 Object value = super.getAsObject(context, component, input); 
    if (value instanceof Long) return BigDecimal.valueOf((Long) value);
    if (value instanceof Double) return BigDecimal.valueOf((Double) value);
   return value;
 }
}